/*    */ package com.lmpop.trade.chooseTemplets;
/*    */ 
/*    */ import java.io.BufferedInputStream;
/*    */ import java.io.BufferedOutputStream;
/*    */ import java.io.DataInputStream;
/*    */ import java.io.DataOutputStream;
/*    */ import java.io.File;
/*    */ import java.io.FileInputStream;
/*    */ import java.io.FileOutputStream;
/*    */ import java.io.IOException;
/*    */ 
/*    */ public class Choose
/*    */ {
/*    */   public void deleteFile(String path2)
/*    */   {
/* 14 */     File f = new File(path2);
/* 15 */     if (f.isDirectory())
/*    */     {
/* 17 */       File[] file = f.listFiles();
/* 18 */       for (File file2 : file) {
/* 19 */         deleteFile(file2.toString());
/* 20 */         file2.delete();
/*    */       }
/*    */     }
/*    */     else {
/* 24 */       f.delete();
/*    */     }
/* 26 */     f.delete();
/*    */   }
/*    */ 
/*    */   public void copyFiles(String path1, String path2)
/*    */     throws Exception
/*    */   {
/* 32 */     File file = new File(path1);
/* 33 */     if (file.isDirectory())
/*    */     {
/* 35 */       File f = new File(path2);
/* 36 */       if (!f.exists()) f.mkdir();
/* 37 */       File[] files = file.listFiles();
/* 38 */       for (File file2 : files)
/*    */       {
/* 40 */         copyFiles(file2.toString(), path2 + "/" + file2.getName());
/*    */       }
/*    */     }
/*    */     else {
/* 44 */       copy(path1, path2);
/*    */     }
/*    */   }
/*    */ 
/*    */   public void copy(String path1, String path2) throws IOException
/*    */   {
/* 50 */     DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(path1)));
/*    */ 
/* 53 */     byte[] date = new byte[in.available()];
/* 54 */     in.read(date);
/* 55 */     DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path2)));
/*    */ 
/* 58 */     out.write(date);
/* 59 */     in.close();
/* 60 */     out.close();
/*    */   }
/*    */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.chooseTemplets.Choose
 * JD-Core Version:    0.6.0
 */